import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

let defaultCity = "上海";

defaultCity = localStorage.city;
const state = {
  city: defaultCity,
  show: false,
};

const mutations = {
  changeCity(state, cityname) {
    state.city = cityname;
    localStorage.city = cityname;
  },
  changeShow(state, show) {
    state.show = show;
  },
};

export default new Vuex.Store({
  state,
  mutations,
});
